package com.xyf.sys.service;

import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
import com.wechat.pay.java.service.payrollcard.model.TransferBatchEntity;
import com.wechat.pay.java.service.profitsharing.model.QueryOrderAmountResponse;
import com.wechat.pay.java.service.refund.model.Refund;
import com.wechat.pay.java.service.refund.model.RefundNotification;
import com.xyf.sys.domain.*;
import com.xyf.sys.vo.*;
import io.swagger.models.auth.In;

import java.util.Date;
import java.util.List;

/**
 * @Author R-H
 * @Date 2024/2/241749
 * @Description
 */
public interface IOrderService {

    Object preOrder(PreOrderVo orderVo);

    String generateOrderOutTradeNo(String mobile, Long timestamp);

    /**
     *  微信支付回调
     * @param transaction
     * @return
     */
    boolean callback(Transaction transaction);

    /**
     *  退款回调
     * @param transaction
     * @return
     */
    boolean refundNotification(RefundNotification transaction);

    OrderPreviewVo previewPrice(OrderPreviewVo orderPriceVo);

    Boolean edit(OrderVo body);

    Order get(String orderId);

    Order create(Order order);

    int update(Order order);

    PreOrderResponseVo pay(String orderId, String userId);

    PreOrderResponseVo pay(String orderId, String userId, String appid);

    List<OrderVo> getList(OrderListRequestVo requestVo);

    Refund orderRefund(OrderRequestVo refundRequestVo);

    OrderVo getDetail(String orderId);

    OrderVo getDetail(String orderId, List<OrderProduct> orderProducts);

    List<OrderProduct> getWaybillNo(String orderId, String userId);

    Object cancel(OrderRequestVo orderRequestVo);

    Object queryLogistic(String orderId, String outTradeNo, String userId, String appid, String secret);

    Object remove(String orderId, String userId);

    Object incrPrintTimes(OrderRequestVo orderRequestVo);

    List<OrderPaymentSummary> paymentList(String startDate, String endDate, String userId, Long deptId, Integer checkType);

    List<OrderPayment> paymentDetailList(String startDate, String endDate, Integer type, String userId, Long subDeptId, Long deptId, Integer checkType);

    Order createCartOrder(List<SysCartItem> itemList, String userId, String regimentId, String appid, String mobile, String userName, Long deptId);

    Order createGoodsOrder(List<GoodsCartItem> itemList, String userId, String regimentId, String appid, UserAddress receiverAddress, Long deptId);

    Order createNewGoodsOrder(List<Goods> itemList, String userId, String appid, UserAddress receiverAddress, Long deptId);

    Order createCartOrder(String userId, UserAddress receiverAddress, String appid, String mobile, Date pickUpDate, String pickUpRange, String orderImg, String remark, Long deptId);

    boolean logisticsEventUpdate(String orderId, String orderProductId, String userId, Long deptId);

    String generateOrderCode();

    boolean addUserLogisticsOrder(String outTradeNo, Long roleId, String userId, Long deptId);

    boolean removeDictDataLogisticsOrder(Long id, String userId, Long deptId);

    boolean submitUserDictData(String userId, Long deptId);

    List<OrderVo> eventList(String userId, String status, Integer eventType, Long deptId);

    Object findNonLogisticsOrderList(OrderRequestVo body);

    List<UserEventStatistic> userOrderEventCount(String userId, Long deptId);

    String generateShortCode();

    Order getByCode(String orderCode);

    OrderBill findByWaybillId(String waybillid);

    PreOrderResponseVo createAssistOrder(PreOrderVo body);

    Object confirmOrder(String orderId, String userId);

    void profitsharingOrder(String orderId);

    void unfreeze(String orderId);
    /**
     *  分账回退
     * @param orderId
     */
    void profitsharingReturn(String orderId);

    /**
     *  查询分账结果
     * @param orderId
     * @param outOrderNo 商户分账单号
     */
    List<OrderProfitsharing> queryProfitsharing(String orderId, String outOrderNo);

    /**
     *  查询剩余待分金额API
     * @param transactionId
     * @return
     */
    QueryOrderAmountResponse queryProfitSharingAmounts(String orderId, String transactionId);

    TransferBatchEntity transfer(String orderId);

    OrderVo updateOrderProductCode(OrderProductCodeVo codeVo);

    Order updateCartOrder(String orderId, List<SysCartItem> list, String userId);

    boolean updateRefundLogistic(String orderId, String orderProductId, String userId, Long deptId);

    Object getWaybillNo(String orderId, List<String> orderProductIds, String deliveryId, String userId);

    Object findOrderByOrderProductCode(String code);

    List<OrderVo> aggregateQuery(OrderListRequestVo requestVo);

    List<OrderPayment> findExportOrderData(String userId, String startDate, String endDate);

    void orderShipments(String orderId, String userId);

    void receiveNotify(String orderId, String userId);

    Order getByTransactionId(String transactionId);

    void sendLaundryShippingMessage(String orderId);

    void delete(String userId);
}
